<template>
  <div style="padding-bottom:200px">
    <!-- 这里就是详情页 -->
    <!-- 无数据时 -->
    <div
      v-if="directoryList.length === 0"
      style="height: 80vh; width: 300px"
      class="noData-2"
    >
      <div class="noData">
        <div class="noData-1">暂无数据</div>
      </div>
    </div>
    <!-- 有数据 -->
    <div v-else>
      <div
        class="wrap"
        style="background:#f7f7f7"
      >
        <div v-for="(moduleList, index) in directoryList" :key="index">
          <!-- 一级变量 -->
          <div :class="{'one-header-top':index===0}" style="margin: 50px 0 10px 20px;background:#f7f7f7;color: #000;font-weight:700;font-size:16px;">
            <span>
              {{ moduleList.item_name }}
            </span>
          </div>
          <!-- 二级变量 -->
          <div v-if="moduleList.second_item">
            <div>
              <div
                v-for="(twoVariable, twoIndex) in moduleList.second_item"
                :key="twoIndex"
                class="wrap"
              >
                <div style="border:1px solid rgba(220, 223, 230, 0.5);" class="item-name pointer" @click="twoVariable.invalid_parameter=!twoVariable.invalid_parameter">
                  <div>
                    <i :class="twoVariable.invalid_parameter?'el-icon-caret-right':'el-icon-caret-bottom'" style="font-size:16px;" />
                    <span>{{ twoVariable.item_name }}</span>
                    <span>
                      <div v-if="twoVariable.question_answer_list.length >= 1">
                        <div v-for="(question_answer_list,index) in twoVariable.question_answer_list" :key="index">
                          <div v-if="question_answer_list.is_connect">
                            <el-radio-group v-model="question_answer_list.answer_data.answer_value" style="display:flex">
                              <div v-for="(item, i) in question_lists.option_list" :key="i">
                                <el-radio
                                  :label="item.option_id"
                                >{{ item.option_name }}
                                </el-radio>
                                <!--其他的时候选择  -->
                                <el-radio>
                                  <el-input
                                    style="width: 60%;height:5%"
                                    placeholder="请输入内容"
                                  />
                                </el-radio>
                              </div>

                            </el-radio-group>
                          </div>
                        </div>
                      </div>
                      <div v-else>
                        <div v-for="(question_lists, one) in twoVariable.question_lists" :key="one">
                          <div v-if="question_lists.is_connect">
                            <el-radio-group v-model="question_lists.answer_data.answer_value" style="display:flex">
                              <div v-for="(item, i) in question_lists.option_list" :key="i">
                                <el-radio
                                  :label="item.option_id"
                                >{{ item.option_name }}
                                </el-radio>
                                <!--其他的时候选择  -->
                                <el-radio>
                                  <el-input
                                    style="width: 60%;height:5%"
                                    placeholder="请输入内容"
                                  />
                                </el-radio>
                              </div>

                            </el-radio-group>
                          </div>
                        </div>
                      </div>

                    </span>
                  </div>
                </div>
                <template v-if="twoVariable.question_answer_list.length >= 1">
                  <el-collapse-transition>
                    <!-- 回答部分 -->
                    <div v-show="!twoVariable.invalid_parameter" style="background-color: #fff;font-size:14px;">
                      <div
                        class="wrap"
                        style="width:100%;display:flex;;flex-wrap:wrap;"
                      >
                        <template v-for="(answer_list) in twoVariable.question_answer_list">
                          <div
                            v-for="(answer,two) in answer_list.relation_answer"
                            :key="two"
                            class="wrap-main"
                            :class="answer.question_type == 0?'dimensionless': ''"
                            :style="{width:answer.question_type== 0 ?'100%':'50%'}"
                          >

                            <!-- 等于0是 变量组 -->
                            <el-col v-if="answer.question_type == 0" style="height:100%;" :span="24" class="dimensionless">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="3">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="21" class="grid-content">
                                    <div v-if="answer.child_question" class="grid-content-align">
                                      <el-row class="grid-main">
                                        <div
                                          class="wrap"
                                          style="width:100%;display:flex;;flex-wrap:wrap;"
                                        >
                                          <div
                                            v-for="newchild in answer.child_question"
                                            :key="newchild.question_id"
                                            class="wrap-main"
                                            :style="{width:'50%'}"
                                          >

                                            <!-- 等于1是单选 -->
                                            <el-col v-if="newchild.question_type == 1" style="height:100%;" :span="24">
                                              <div class="grid-child">
                                                <el-row class="grid-child-row" type="flex" align="center">
                                                  <el-col :span="6">
                                                    <div class="grid-content-name-align">
                                                      <!-- 这里就是操作元素隐藏显示 -->
                                                      <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                    </div>
                                                  </el-col>
                                                  <el-col :span="18" class="grid-content">
                                                    <div v-if="newchild.option_list" class="grid-content-align">
                                                      <el-radio-group v-model="newchild.answer_data.answer_value[0]">
                                                        <div
                                                          v-for="list in newchild.option_list"
                                                          :key="list.option_id"
                                                          style="padding:8px;float:left;"
                                                        >
                                                          <el-radio
                                                            :disabled="readorcompile===0? true:false"
                                                            :label="list.option_id"
                                                            @click.native.prevent="clickitem(list,newchild, twoVariable)"
                                                          >
                                                            {{ list.option_name }}
                                                          </el-radio>
                                                          <el-input
                                                            v-if="list.is_other== 1
                                                              &&
                                                              newchild.answer_data.answer_value ==
                                                              list.option_id"
                                                            v-model=" newchild.answer_data.other_data_value[list.option_id]"
                                                            :disabled="readorcompile===0? true:false"
                                                            class="other_input"
                                                            style="width: 40%"
                                                            @input="ChoiceInput(list,newchild, twoVariable)"
                                                          />
                                                        </div>
                                                      </el-radio-group>
                                                      <!-- <el-radio-group v-model="radio">
                                                        <el-radio :label="3">备选项</el-radio>
                                                        <el-radio :label="6">备选项</el-radio>
                                                        <el-radio :label="9">备选项</el-radio>
                                                      </el-radio-group> -->
                                                    </div>
                                                  </el-col>
                                                </el-row>
                                              </div>
                                            </el-col>
                                            <!-- 等于2是多选 -->
                                            <el-col v-else-if="newchild.question_type == 2" style="height:100%;" :span="24">
                                              <div class="grid-child">
                                                <el-row class="grid-child-row" type="flex" align="center">
                                                  <el-col :span="6">
                                                    <div class="grid-content-name-align">
                                                      <!-- 这里就是操作元素隐藏显示 -->
                                                      <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                    </div>
                                                  </el-col>
                                                  <el-col :span="18" class="grid-content">
                                                    <div v-if="newchild.option_list" class="grid-content-align">
                                                      <el-checkbox-group
                                                        v-model="newchild.answer_data.answer_value"
                                                      >
                                                        <div v-for="(lists, index) in newchild.option_list" :key="index" style="float:left;">
                                                          <el-checkbox
                                                            class="grid-content-align-checkbox"
                                                            :disabled="readorcompile===0? true:false"
                                                            :label="lists.option_id"
                                                            @click.native.prevent="changeinput(lists,newchild,twoVariable)"
                                                          >
                                                            {{ lists.option_name }}
                                                          </el-checkbox>
                                                          <el-input
                                                            v-if="lists.is_other== 1
                                                              &&
                                                              newchild.answer_data.answer_value.indexOf(lists.option_id) != -1"
                                                            v-model="newchild.answer_data.other_data_value[lists.option_id]"
                                                            :disabled="readorcompile===0? true:false"
                                                            class="other_input"
                                                            style="width: 40%"
                                                            @input="ChoiceInputs(lists,newchild, twoVariable)"
                                                          />
                                                        </div>

                                                      </el-checkbox-group>
                                                    </div>
                                                  </el-col>
                                                </el-row>
                                              </div>
                                            </el-col>
                                            <!-- 等于3是下拉 -->
                                            <el-col v-else-if="newchild.question_type == 3" style="height:100%;" :span="24">
                                              <div class="grid-child">
                                                <el-row class="grid-child-row" type="flex" align="center">
                                                  <el-col :span="6">
                                                    <div class="grid-content-name-align">
                                                      <!-- 这里就是操作元素隐藏显示 -->
                                                      <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                    </div>
                                                  </el-col>
                                                  <el-col :span="18" class="grid-content">
                                                    <div class="grid-content-align">
                                                      <el-select
                                                        v-model="newchild.answer_data.answer_value"
                                                        :disabled="readorcompile===0? true:false"
                                                        placeholder="请选择"
                                                        @change="pullDown(newchild,twoVariable)"
                                                      >
                                                        <el-option
                                                          v-for="lists in newchild.option_list"

                                                          :key="lists.option_id"
                                                          :label="lists.option_name"
                                                          :value="lists.option_id"
                                                        />
                                                      </el-select>
                                                    </div>
                                                  </el-col>
                                                </el-row>
                                              </div>
                                            </el-col>
                                            <!-- 等于4是附件上传 -->
                                            <el-col v-else-if="newchild.question_type == 4" style="height:100%;" :span="24">
                                              <div class="grid-child">
                                                <el-row class="grid-child-row" type="flex" align="center">
                                                  <el-col :span="6">
                                                    <div class="grid-content-name-align">
                                                      <!-- 这里就是操作元素隐藏显示 -->
                                                      <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                    </div>
                                                  </el-col>
                                                  <el-col :span="18" class="grid-content">
                                                    <div class="grid-content-align">
                                                      <el-upload
                                                        :disabled="readorcompile===0? true:false"
                                                        class="upload-demo"
                                                        :action="processDevelopment?'/api/db/Common/upload' : '/db/Common/upload'"
                                                        :on-success="newpreview"
                                                        :on-remove="newremove"
                                                        :on-change="newonChange"
                                                        @click.native="newremoves($event,newchild,twoVariable)"
                                                      >
                                                        <div class="upload-demo-btn"><el-button size="small" type="primary" @click="clickUpload(newchild,twoVariable)">点击上传</el-button></div>
                                                        <div class="upload-demo-tip el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
                                                        <div v-for="(item) in newchild.answer_data.answer_value" :key="item" class="upload-demo-text" @click.stop="newDevelopment(item)">
                                                          <div v-if="processDevelopment" class="upload-demo-text-align">
                                                            <i class="el-icon-document" />
                                                            <span>{{ getImgName(item) }}</span>

                                                          </div>
                                                          <div v-else class="upload-demo-text-align">
                                                            <i class="el-icon-document" />
                                                            <span>{{ getTextName(item) }}</span>
                                                          </div>
                                                          <!-- <i class="el-icon-upload-success el-icon-circle-check" style="color:#67c23a" /> -->
                                                          <!-- 文件删除 -->
                                                          <i class="el-icon-close upload-demo-text-close" @click.stop="fileDeleteI(item,newchild,twoVariable)" />
                                                        </div>
                                                      </el-upload>
                                                    </div>
                                                  </el-col>
                                                </el-row>
                                              </div>
                                            </el-col>
                                            <!-- 等于5是单行文本 -->
                                            <el-col v-else-if="newchild.question_type == 5" style="height:100%;" :span="24">
                                              <div class="grid-child">
                                                <el-row class="grid-child-row" type="flex" align="center">
                                                  <el-col :span="6">
                                                    <div class="grid-content-name-align">
                                                      <!-- 这里就是操作元素隐藏显示 -->
                                                      <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                    </div>
                                                  </el-col>
                                                  <el-col :span="18" class="grid-content">
                                                    <div class="grid-content-align">
                                                      <!-- QID/姓名 -->
                                                      <el-input
                                                        v-model="newchild.answer_data.answer_value"
                                                        :disabled="readorcompile===0? true:false"
                                                        maxlength="20"
                                                        show-word-limit
                                                        placeholder="请输入内容"
                                                        style="width: 220px;margin-left: 10px"
                                                        @input="inputBox(newchild,twoVariable)"
                                                      />
                                                    </div>
                                                  </el-col>
                                                </el-row>
                                              </div>
                                            </el-col>
                                            <!-- 等于6是多行文本 -->
                                            <el-col v-else-if="newchild.question_type == 6" style="height:100%;" :span="24">
                                              <div class="grid-child">
                                                <el-row class="grid-child-row" type="flex" align="center">
                                                  <el-col :span="6">
                                                    <div class="grid-content-name-align">
                                                      <!-- 这里就是操作元素隐藏显示 -->
                                                      <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                    </div>
                                                  </el-col>
                                                  <el-col :span="18" class="grid-content">
                                                    <div class="grid-content-align">
                                                      <el-input
                                                        v-model="newchild.answer_data.answer_value"
                                                        :disabled="readorcompile===0? true:false"
                                                        type="textarea"
                                                        style="width: 150px;margin-left: 10px"
                                                        placeholder="请输入内容"
                                                        @input="multiLineText(newchild,twoVariable)"
                                                      />
                                                    </div>
                                                  </el-col>
                                                </el-row>
                                              </div>
                                            </el-col>
                                            <!-- 等于7是时间 -->
                                            <el-col v-else-if="newchild.question_type == 7" style="height:100%;" :span="24">
                                              <div class="grid-child">
                                                <el-row class="grid-child-row" type="flex" align="center">
                                                  <el-col :span="6">
                                                    <div class="grid-content-name-align">
                                                      <!-- 这里就是操作元素隐藏显示 -->
                                                      <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                    </div>
                                                  </el-col>
                                                  <el-col :span="18" class="grid-content">
                                                    <div class="grid-content-align">
                                                      <div
                                                        style="margin-left: 10px;display: flex;align-items: center;"
                                                      >
                                                        <el-date-picker
                                                          v-model="newchild.answer_data.answer_value"
                                                          :disabled="readorcompile===0? true:false"
                                                          type="date"
                                                          prefix-icon="el-icon-time"
                                                          format="yyyy-MM-dd"
                                                          placeholder="选择日期"
                                                          value-format="yyyy-MM-dd"
                                                          @change="newTime(newchild,twoVariable)"
                                                        />
                                                      </div>
                                                    </div>
                                                  </el-col>
                                                </el-row>
                                              </div>
                                            </el-col>

                                          </div>
                                        </div>
                                      </el-row>
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                            <!-- 等于1是单选 -->
                            <el-col v-if="answer.question_type == 1" style="height:100%;" :span="24">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="6">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="18" class="grid-content">
                                    <div v-if="answer.option_list" class="grid-content-align">
                                      <el-radio-group v-model="answer.answer_data.answer_value[0]">
                                        <div
                                          v-for="list in answer.option_list"
                                          :key="list.option_id"
                                          style="padding:8px;float:left;"
                                        >
                                          <el-radio
                                            :disabled="readorcompile===0? true:false"
                                            :label="list.option_id"
                                            @click.native.prevent="clickitem(list,answer, twoVariable)"
                                          >
                                            {{ list.option_name }}
                                          </el-radio>
                                          <el-input
                                            v-if="list.is_other== 1
                                              &&
                                              answer.answer_data.answer_value ==
                                              list.option_id"
                                            v-model=" answer.answer_data.other_data_value[list.option_id]"
                                            :disabled="readorcompile===0? true:false"
                                            class="other_input"
                                            style="width: 40%"
                                            @input="ChoiceInput(list,answer, twoVariable)"
                                          />
                                        </div>
                                      </el-radio-group>
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                            <!-- 等于2是多选 -->
                            <el-col v-else-if="answer.question_type == 2" style="height:100%;" :span="24">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="6">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="18" class="grid-content">
                                    <div v-if="answer.option_list" class="grid-content-align">
                                      <el-checkbox-group
                                        v-model="answer.answer_data.answer_value"
                                      >
                                        <div v-for="(lists, index) in answer.option_list" :key="index" style="float:left;margin:5px 10px">
                                          <el-checkbox
                                            :disabled="readorcompile===0? true:false"
                                            class="grid-content-align-checkbox"
                                            :label="lists.option_id"
                                            @click.native.prevent="changeinput(lists,answer,twoVariable)"
                                          >
                                            {{ lists.option_name }}
                                          </el-checkbox>
                                          <el-input
                                            v-if="lists.is_other== 1
                                              &&
                                              answer.answer_data.answer_value.indexOf(lists.option_id) != -1"
                                            v-model="answer.answer_data.other_data_value[lists.option_id]"
                                            :disabled="readorcompile===0? true:false"
                                            class="other_input"
                                            style="width: 40%"
                                            @input="ChoiceInputs(lists,answer, twoVariable)"
                                          />
                                        </div>

                                      </el-checkbox-group>
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                            <!-- 等于3是下拉 -->
                            <el-col v-else-if="answer.question_type == 3" style="height:100%;" :span="24">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="6">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="18" class="grid-content">
                                    <div class="grid-content-align">
                                      <el-select
                                        v-model="answer.answer_data.answer_value"
                                        :disabled="readorcompile===0? true:false"
                                        placeholder="请选择"
                                        @change="pullDown(answer,twoVariable)"
                                      >
                                        <el-option
                                          v-for="lists in answer.option_list"
                                          :key="lists.option_id"
                                          :label="lists.option_name"
                                          :value="lists.option_id"
                                        />
                                      </el-select>
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                            <!-- 等于4是附件上传 -->
                            <el-col v-else-if="answer.question_type == 4" style="height:100%;" :span="24">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="6">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="18" class="grid-content">
                                    <div class="grid-content-align">
                                      <el-upload
                                        :disabled="readorcompile===0? true:false"
                                        class="upload-demo"
                                        :action="processDevelopment?'/api/db/Common/upload' : '/db/Common/upload'"
                                        :on-success="newpreview"
                                        :on-remove="newremove"
                                        :on-change="newonChange"
                                        @click.native="newremoves($event,answer,twoVariable)"
                                      >
                                        <div class="upload-demo-btn"><el-button size="small" type="primary" @click="clickUpload(answer,twoVariable)">点击上传</el-button></div>
                                        <div class="upload-demo-tip el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
                                        <div v-for="(item) in answer.answer_data.answer_value" :key="item" class="upload-demo-text" @click.stop="newDevelopment(item)">
                                          <div v-if="processDevelopment" class="upload-demo-text-align">
                                            <i class="el-icon-document" />
                                            <span>{{ getImgName(item) }}</span>

                                          </div>
                                          <div v-else class="upload-demo-text-align">
                                            <i class="el-icon-document" />
                                            <span>{{ getTextName(item) }}</span>
                                          </div>
                                          <!-- <i class="el-icon-upload-success el-icon-circle-check" style="color:#67c23a" /> -->
                                          <!-- 文件删除 -->
                                          <i class="el-icon-close upload-demo-text-close" @click.stop="fileDeleteI(item,answer,twoVariable)" />
                                        </div>
                                      </el-upload>
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                            <!-- 等于5是单行文本 -->
                            <el-col v-else-if="answer.question_type == 5" style="height:100%;" :span="24">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="6">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="18" class="grid-content">
                                    <div class="grid-content-align">
                                      <!-- QID/姓名 -->
                                      <el-input
                                        v-model="answer.answer_data.answer_value"
                                        :disabled="readorcompile===0? true:false"
                                        maxlength="20"
                                        show-word-limit
                                        placeholder="请输入内容"
                                        style="width: 220px;margin-left: 10px"
                                        @input="inputBox(answer,twoVariable)"
                                      />
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                            <!-- 等于6是多行文本 -->
                            <el-col v-else-if="answer.question_type == 6" style="height:100%;" :span="24">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="6">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="18" class="grid-content">
                                    <div class="grid-content-align">
                                      <el-input
                                        v-model="answer.answer_data.answer_value"
                                        :disabled="readorcompile===0? true:false"
                                        type="textarea"
                                        style="width: 150px;margin-left: 10px"
                                        placeholder="请输入内容"
                                        @input="multiLineText(answer,twoVariable)"
                                      />
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                            <!-- 等于7是时间 -->
                            <el-col v-else-if="answer.question_type == 7" style="height:100%;" :span="24">
                              <div class="grid-child">
                                <el-row class="grid-child-row" type="flex" align="center">
                                  <el-col :span="6">
                                    <div class="grid-content-name-align">
                                      <!-- 这里就是操作元素隐藏显示 -->
                                      <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                    </div>
                                  </el-col>
                                  <el-col :span="18" class="grid-content">
                                    <div class="grid-content-align">
                                      <div
                                        style="margin-left: 10px;display: flex;align-items: center;"
                                      >
                                        <el-date-picker
                                          v-model="answer.answer_data.answer_value"
                                          :disabled="readorcompile===0? true:false"
                                          type="date"
                                          prefix-icon="el-icon-time"
                                          format="yyyy-MM-dd"
                                          placeholder="选择日期"
                                          value-format="yyyy-MM-dd"
                                          @change="newTime(answer,twoVariable)"
                                        />
                                      </div>
                                    </div>
                                  </el-col>
                                </el-row>
                              </div>
                            </el-col>
                          </div>
                        </template>
                      </div>
                    </div>
                  </el-collapse-transition>
                </template>
                <template v-else>
                  <el-collapse-transition>
                    <!-- 回答部分 -->
                    <div v-show="!twoVariable.invalid_parameter" style="background-color: #fff;font-size:14px;">
                      <div
                        class="wrap"
                        style="width:100%;display:flex;;flex-wrap:wrap;"
                      >
                        <div
                          v-for="(answer, one) in twoVariable.question_lists"
                          :key="one"
                          class="wrap-main"
                          :class="answer.question_type == 0?'dimensionless': ''"
                          :style="{width:answer.question_type== 0 ?'100%':'50%'}"
                        >

                          <!-- 等于0是 变量组 -->
                          <el-col v-if="answer.question_type == 0" style="height:100%;" :span="24" class="dimensionless">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="3">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="21" class="grid-content">
                                  <div v-if="answer.child_question" class="grid-content-align">
                                    <el-row class="grid-main">
                                      <div
                                        class="wrap"
                                        style="width:100%;display:flex;;flex-wrap:wrap;"
                                      >
                                        <div
                                          v-for="newchild in answer.child_question"
                                          :key="newchild.question_id"
                                          class="wrap-main"
                                          :style="{width:'50%'}"
                                        >

                                          <!-- 等于1是单选 -->
                                          <el-col v-if="newchild.question_type == 1" style="height:100%;" :span="24">
                                            <div class="grid-child">
                                              <el-row class="grid-child-row" type="flex" align="center">
                                                <el-col :span="6">
                                                  <div class="grid-content-name-align">
                                                    <!-- 这里就是操作元素隐藏显示 -->
                                                    <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                  </div>
                                                </el-col>
                                                <el-col :span="18" class="grid-content">
                                                  <div v-if="newchild.option_list" class="grid-content-align">
                                                    <el-radio-group v-model="newchild.answer_data.answer_value[0]">
                                                      <div
                                                        v-for="list in newchild.option_list"
                                                        :key="list.option_id"
                                                        style="padding:8px;float:left;"
                                                      >
                                                        <el-radio
                                                          :disabled="readorcompile===0? true:false"
                                                          :label="list.option_id"
                                                          @click.native.prevent="clickitem(list,newchild, twoVariable)"
                                                        >
                                                          {{ list.option_name }}
                                                        </el-radio>
                                                        <el-input
                                                          v-if="list.is_other== 1
                                                            &&
                                                            newchild.answer_data.answer_value ==
                                                            list.option_id"
                                                          v-model=" newchild.answer_data.other_data_value[list.option_id]"
                                                          :disabled="readorcompile===0? true:false"
                                                          class="other_input"
                                                          style="width: 40%"
                                                          @input="ChoiceInput(list,newchild, twoVariable)"
                                                        />
                                                      </div>
                                                    </el-radio-group>
                                                    <!-- <el-radio-group v-model="radio">
                                                        <el-radio :label="3">备选项</el-radio>
                                                        <el-radio :label="6">备选项</el-radio>
                                                        <el-radio :label="9">备选项</el-radio>
                                                      </el-radio-group> -->
                                                  </div>
                                                </el-col>
                                              </el-row>
                                            </div>
                                          </el-col>
                                          <!-- 等于2是多选 -->
                                          <el-col v-else-if="newchild.question_type == 2" style="height:100%;" :span="24">
                                            <div class="grid-child">
                                              <el-row class="grid-child-row" type="flex" align="center">
                                                <el-col :span="6">
                                                  <div class="grid-content-name-align">
                                                    <!-- 这里就是操作元素隐藏显示 -->
                                                    <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                  </div>
                                                </el-col>
                                                <el-col :span="18" class="grid-content">
                                                  <div v-if="newchild.option_list" class="grid-content-align">
                                                    <el-checkbox-group
                                                      v-model="newchild.answer_data.answer_value"
                                                    >
                                                      <div v-for="(lists, index) in newchild.option_list" :key="index" style="float:left;">
                                                        <el-checkbox
                                                          class="grid-content-align-checkbox"
                                                          :label="lists.option_id"
                                                          :disabled="readorcompile===0? true:false"
                                                          @click.native.prevent="changeinput(lists,newchild,twoVariable)"
                                                        >
                                                          {{ lists.option_name }}
                                                        </el-checkbox>
                                                        <el-input
                                                          v-if="lists.is_other== 1
                                                            &&
                                                            newchild.answer_data.answer_value.indexOf(lists.option_id) != -1"
                                                          v-model="newchild.answer_data.other_data_value[lists.option_id]"
                                                          :disabled="readorcompile===0? true:false"
                                                          class="other_input"
                                                          style="width: 40%"
                                                          @input="ChoiceInputs(lists,newchild, twoVariable)"
                                                        />
                                                      </div>

                                                    </el-checkbox-group>
                                                  </div>
                                                </el-col>
                                              </el-row>
                                            </div>
                                          </el-col>
                                          <!-- 等于3是下拉 -->
                                          <el-col v-else-if="newchild.question_type == 3" style="height:100%;" :span="24">
                                            <div class="grid-child">
                                              <el-row class="grid-child-row" type="flex" align="center">
                                                <el-col :span="6">
                                                  <div class="grid-content-name-align">
                                                    <!-- 这里就是操作元素隐藏显示 -->
                                                    <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                  </div>
                                                </el-col>
                                                <el-col :span="18" class="grid-content">
                                                  <div class="grid-content-align">
                                                    <el-select
                                                      v-model="newchild.answer_data.answer_value"
                                                      placeholder="请选择"
                                                      :disabled="readorcompile===0? true:false"
                                                      @change="pullDown(newchild,twoVariable)"
                                                    >
                                                      <el-option
                                                        v-for="lists in newchild.option_list"
                                                        :key="lists.option_id"
                                                        :label="lists.option_name"
                                                        :value="lists.option_id"
                                                      />
                                                    </el-select>
                                                  </div>
                                                </el-col>
                                              </el-row>
                                            </div>
                                          </el-col>
                                          <!-- 等于4是附件上传 -->
                                          <el-col v-else-if="newchild.question_type == 4" style="height:100%;" :span="24">
                                            <div class="grid-child">
                                              <el-row class="grid-child-row" type="flex" align="center">
                                                <el-col :span="6">
                                                  <div class="grid-content-name-align">
                                                    <!-- 这里就是操作元素隐藏显示 -->
                                                    <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                  </div>
                                                </el-col>
                                                <el-col :span="18" class="grid-content">
                                                  <div class="grid-content-align">
                                                    <el-upload
                                                      class="upload-demo"
                                                      :action="processDevelopment?'/api/db/Common/upload' : '/db/Common/upload'"
                                                      :on-success="newpreview"
                                                      :on-remove="newremove"
                                                      :on-change="newonChange"
                                                      :disabled="readorcompile===0? true:false"
                                                      @click.native="newremoves($event,newchild,twoVariable)"
                                                    >
                                                      <div class="upload-demo-btn"><el-button size="small" type="primary" @click="clickUpload(newchild,twoVariable)">点击上传</el-button></div>
                                                      <div class="upload-demo-tip el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
                                                      <div v-for="(item) in newchild.answer_data.answer_value" :key="item" class="upload-demo-text" @click.stop="newDevelopment(item)">
                                                        <div v-if="processDevelopment" class="upload-demo-text-align">
                                                          <i class="el-icon-document" />
                                                          <span>{{ getImgName(item) }}</span>

                                                        </div>
                                                        <div v-else class="upload-demo-text-align">
                                                          <i class="el-icon-document" />
                                                          <span>{{ getTextName(item) }}</span>
                                                        </div>
                                                        <!-- <i class="el-icon-upload-success el-icon-circle-check" style="color:#67c23a" /> -->
                                                        <!-- 文件删除 -->
                                                        <i class="el-icon-close upload-demo-text-close" @click.stop="fileDeleteI(item,newchild,twoVariable)" />
                                                      </div>
                                                    </el-upload>
                                                  </div>
                                                </el-col>
                                              </el-row>
                                            </div>
                                          </el-col>
                                          <!-- 等于5是单行文本 -->
                                          <el-col v-else-if="newchild.question_type == 5" style="height:100%;" :span="24">
                                            <div class="grid-child">
                                              <el-row class="grid-child-row" type="flex" align="center">
                                                <el-col :span="6">
                                                  <div class="grid-content-name-align">
                                                    <!-- 这里就是操作元素隐藏显示 -->
                                                    <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                  </div>
                                                </el-col>
                                                <el-col :span="18" class="grid-content">
                                                  <div class="grid-content-align">
                                                    <!-- QID/姓名 -->
                                                    <el-input
                                                      v-model="newchild.answer_data.answer_value"
                                                      :disabled="readorcompile===0? true:false"
                                                      maxlength="20"
                                                      show-word-limit
                                                      placeholder="请输入内容"
                                                      style="width: 220px;margin-left: 10px"
                                                      @input="inputBox(newchild,twoVariable)"
                                                    />
                                                  </div>
                                                </el-col>
                                              </el-row>
                                            </div>
                                          </el-col>
                                          <!-- 等于6是多行文本 -->
                                          <el-col v-else-if="newchild.question_type == 6" style="height:100%;" :span="24">
                                            <div class="grid-child">
                                              <el-row class="grid-child-row" type="flex" align="center">
                                                <el-col :span="6">
                                                  <div class="grid-content-name-align">
                                                    <!-- 这里就是操作元素隐藏显示 -->
                                                    <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                  </div>
                                                </el-col>
                                                <el-col :span="18" class="grid-content">
                                                  <div class="grid-content-align">
                                                    <el-input
                                                      v-model="newchild.answer_data.answer_value"
                                                      :disabled="readorcompile===0? true:false"
                                                      type="textarea"
                                                      style="width: 150px;margin-left: 10px"
                                                      placeholder="请输入内容"
                                                      @input="multiLineText(newchild,twoVariable)"
                                                    />
                                                  </div>
                                                </el-col>
                                              </el-row>
                                            </div>
                                          </el-col>
                                          <!-- 等于7是时间 -->
                                          <el-col v-else-if="newchild.question_type == 7" style="height:100%;" :span="24">
                                            <div class="grid-child">
                                              <el-row class="grid-child-row" type="flex" align="center">
                                                <el-col :span="6">
                                                  <div class="grid-content-name-align">
                                                    <!-- 这里就是操作元素隐藏显示 -->
                                                    <div class="grid-content-name-align-left"><span>{{ newchild.question_name }}</span></div>
                                                  </div>
                                                </el-col>
                                                <el-col :span="18" class="grid-content">
                                                  <div class="grid-content-align">
                                                    <div
                                                      style="margin-left: 10px;display: flex;align-items: center;"
                                                    >
                                                      <el-date-picker
                                                        v-model="newchild.answer_data.answer_value"
                                                        :disabled="readorcompile===0? true:false"
                                                        type="date"
                                                        prefix-icon="el-icon-time"
                                                        format="yyyy-MM-dd"
                                                        placeholder="选择日期"
                                                        value-format="yyyy-MM-dd"
                                                        @change="newTime(newchild,twoVariable)"
                                                      />
                                                    </div>
                                                  </div>
                                                </el-col>
                                              </el-row>
                                            </div>
                                          </el-col>

                                        </div>
                                      </div>
                                    </el-row>
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                          <!-- 等于1是单选 -->
                          <el-col v-if="answer.question_type == 1" style="height:100%;" :span="24">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="6">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="18" class="grid-content">
                                  <div v-if="answer.option_list" class="grid-content-align">
                                    <el-radio-group v-model="answer.answer_data.answer_value[0]">
                                      <div
                                        v-for="list in answer.option_list"
                                        :key="list.option_id"
                                        style="padding:8px;float:left;"
                                      >
                                        <el-radio
                                          :disabled="readorcompile===0? true:false"
                                          :label="list.option_id"
                                          @click.native.prevent="clickitem(list,answer, twoVariable)"
                                        >
                                          {{ list.option_name }}
                                        </el-radio>
                                        <el-input
                                          v-if="list.is_other== 1
                                            &&
                                            answer.answer_data.answer_value ==
                                            list.option_id"
                                          v-model=" answer.answer_data.other_data_value[list.option_id]"
                                          :disabled="readorcompile===0? true:false"
                                          class="other_input"
                                          style="width: 40%"
                                          @input="ChoiceInput(list,answer, twoVariable)"
                                        />
                                      </div>
                                    </el-radio-group>
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                          <!-- 等于2是多选 -->
                          <el-col v-else-if="answer.question_type == 2" style="height:100%;" :span="24">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="6">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="18" class="grid-content">
                                  <div v-if="answer.option_list" class="grid-content-align">
                                    <el-checkbox-group
                                      v-model="answer.answer_data.answer_value"
                                    >
                                      <div v-for="(lists, index) in answer.option_list" :key="index" style="float:left;margin:5px 10px">
                                        <el-checkbox
                                          :disabled="readorcompile===0? true:false"
                                          class="grid-content-align-checkbox"
                                          :label="lists.option_id"
                                          @click.native.prevent="changeinput(lists,answer,twoVariable)"
                                        >
                                          {{ lists.option_name }}
                                        </el-checkbox>
                                        <el-input
                                          v-if="lists.is_other== 1
                                            &&
                                            answer.answer_data.answer_value.indexOf(lists.option_id) != -1"
                                          v-model="answer.answer_data.other_data_value[lists.option_id]"
                                          :disabled="readorcompile===0? true:false"
                                          class="other_input"
                                          style="width: 40%"
                                          @input="ChoiceInputs(lists,answer, twoVariable)"
                                        />
                                      </div>

                                    </el-checkbox-group>
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                          <!-- 等于3是下拉 -->
                          <el-col v-else-if="answer.question_type == 3" style="height:100%;" :span="24">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="6">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="18" class="grid-content">
                                  <div class="grid-content-align">
                                    <el-select
                                      v-model="answer.answer_data.answer_value"
                                      :disabled="readorcompile===0? true:false"
                                      placeholder="请选择"
                                      @change="pullDown(answer,twoVariable)"
                                    >
                                      <el-option
                                        v-for="lists in answer.option_list"
                                        :key="lists.option_id"
                                        :label="lists.option_name"
                                        :value="lists.option_id"
                                      />
                                    </el-select>
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                          <!-- 等于4是附件上传 -->
                          <el-col v-else-if="answer.question_type == 4" style="height:100%;" :span="24">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="6">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="18" class="grid-content">
                                  <div class="grid-content-align">
                                    <el-upload
                                      :disabled="readorcompile===0? true:false"
                                      class="upload-demo"
                                      :action="processDevelopment?'/api/db/Common/upload' : '/db/Common/upload'"
                                      :on-success="newpreview"
                                      :on-remove="newremove"
                                      :on-change="newonChange"
                                      @click.native="newremoves($event,answer,twoVariable)"
                                    >
                                      <div class="upload-demo-btn"><el-button size="small" type="primary" @click="clickUpload(answer,twoVariable)">点击上传</el-button></div>
                                      <div class="upload-demo-tip el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
                                      <div v-for="(item) in answer.answer_data.answer_value" :key="item" class="upload-demo-text" @click.stop="newDevelopment(item)">
                                        <div v-if="processDevelopment" class="upload-demo-text-align">
                                          <i class="el-icon-document" />
                                          <span>{{ getImgName(item) }}</span>

                                        </div>
                                        <div v-else class="upload-demo-text-align">
                                          <i class="el-icon-document" />
                                          <span>{{ getTextName(item) }}</span>
                                        </div>
                                        <!-- <i class="el-icon-upload-success el-icon-circle-check" style="color:#67c23a" /> -->
                                        <!-- 文件删除 -->
                                        <i class="el-icon-close upload-demo-text-close" @click.stop="fileDeleteI(item,answer,twoVariable)" />
                                      </div>
                                    </el-upload>
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                          <!-- 等于5是单行文本 -->
                          <el-col v-else-if="answer.question_type == 5" style="height:100%;" :span="24">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="6">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="18" class="grid-content">
                                  <div class="grid-content-align">
                                    <!-- QID/姓名 -->
                                    <el-input
                                      v-model="answer.answer_data.answer_value"
                                      :disabled="readorcompile===0? true:false"
                                      maxlength="20"
                                      show-word-limit
                                      placeholder="请输入内容"
                                      style="width: 220px;margin-left: 10px"
                                      @input="inputBox(answer,twoVariable)"
                                    />
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                          <!-- 等于6是多行文本 -->
                          <el-col v-else-if="answer.question_type == 6" style="height:100%;" :span="24">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="6">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="18" class="grid-content">
                                  <div class="grid-content-align">
                                    <el-input
                                      v-model="answer.answer_data.answer_value"
                                      :disabled="readorcompile===0? true:false"
                                      type="textarea"
                                      style="width: 150px;margin-left: 10px"
                                      placeholder="请输入内容"
                                      @input="multiLineText(answer,twoVariable)"
                                    />
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                          <!-- 等于7是时间 -->
                          <el-col v-else-if="answer.question_type == 7" style="height:100%;" :span="24">
                            <div class="grid-child">
                              <el-row class="grid-child-row" type="flex" align="center">
                                <el-col :span="6">
                                  <div class="grid-content-name-align">
                                    <!-- 这里就是操作元素隐藏显示 -->
                                    <div class="grid-content-name-align-left"><span>{{ answer.question_name }}</span></div>
                                  </div>
                                </el-col>
                                <el-col :span="18" class="grid-content">
                                  <div class="grid-content-align">
                                    <div
                                      style="margin-left: 10px;display: flex;align-items: center;"
                                    >
                                      <el-date-picker
                                        v-model="answer.answer_data.answer_value"
                                        :disabled="readorcompile===0? true:false"
                                        type="date"
                                        prefix-icon="el-icon-time"
                                        format="yyyy-MM-dd"
                                        placeholder="选择日期"
                                        value-format="yyyy-MM-dd"
                                        @change="newTime(answer,twoVariable)"
                                      />
                                    </div>
                                  </div>
                                </el-col>
                              </el-row>
                            </div>
                          </el-col>
                        </div>
                      </div>
                    </div>
                  </el-collapse-transition>
                </template>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    directoryList: { type: Array, default: () => [] }, // 渲染的数据
    newdirectoryListLists: { type: Boolean, default: false }, // 是否清空数据
    readorcompile: { type: Number, default: 0 } // 编辑页还是预览页
  },
  data() {
    return {
      radio: '2',
      newregistration: [], // 拼接数据
      newsupload: [], // 上传图片的自身数据
      newTwoVariable: [], // 上传图片的二级模块的数据
      removeDelate: false, // 删除图片时候调用
      DetalReomve: [], // 用户点击删除图片的时候的数据
      previewInsert: false, // 用户点击 新增数据 改变数据 预览
      processDevelopment: false, // 确定环境
      windowLocationHost: `'http://' + ${window.location.host}`,
      directoryListList: [] // 用户保存的数据
    }
  },
  computed: {
    // 获取上传图片名字
    getImgName() {
      return (item) => {
        console.log('item', item.url)
        return (item.url.split('__')[1] + '.' + item.url.split('.')[item.url.split('.').length - 1])
      }
    },
    // 获取上传文件名字
    getTextName() {
      return (item) => {
        return (item.url.split('__')[1] + '.' + item.url.split('.')[item.url.split('.').length - 1])
      }
    }
    // console.log('2222this.directoryList',this.directoryList);
  },
  watch: {
    newdirectoryListLists: {
      handler() {
        if (this.newdirectoryListLists) {
          console.log('newdirectoryListLists等于true')
          this.directoryListList = []
        }
      }
    },
    // 显示隐藏
    readorcompile: {
      handler(val) {
        console.log('在detail库的readorcompile的值', val)
      }
    }
  },
  created() {
    console.log('process.env.NODE_ENV === development,', process.env.NODE_ENV)
    if (process.env.NODE_ENV === 'development') {
      this.processDevelopment = true
    } else {
      this.processDevelopment = false
    }
    console.log('this.processDevelopmentthis.processDevelopment', this.processDevelopment)
  },

  methods: {
    // 将用户的数据拼接起来存起来
    dataStorage(e, item, twoVariable) {
      this.newregistration = []
      // item[e.option_id].
      const questionData = []
      // 单选
      if (item.question_type === 1) {
        let z = ''
        if (item.answer_data.other_data_value) {
          z = item.answer_data.other_data_value[e.option_id]
        }
        let db_data_id
        if (item.answer_data.db_data_id) {
          db_data_id = item.answer_data.db_data_id
        } else {
          db_data_id = ''
        }
        if (z === undefined) {
          z = ''
        }
        // e.question_id
        if (item.answer_data.answer_value.length === 1) {
          questionData[0] = {
            question_id: item.question_id,
            db_data_id: db_data_id,
            answer_value:
            e.is_other === 1 ? [item.answer_data.answer_value + '&=>' + z] : item.answer_data.answer_value

          }
        } else {
          questionData[0] = {
            question_id: item.question_id,
            db_data_id: db_data_id,
            answer_value:
            e.is_other === 1 ? [item.answer_data.answer_value + '&=>' + z] : [item.answer_data.answer_value]

          }
        }
      }
      // 多选
      if (item.question_type === 2) {
        // if (item.answer_data.answer_value.length === 1) {
        // 创建
        console.log('进来了', e, item, twoVariable)
        const newAnswer_values = []

        // }
        console.log('d多选')
        const z = []
        // if (item.answer_data.other_data_value) {
        //   z = item.answer_data.other_data_value[e.option_id]
        // }
        let db_data_id
        if (item.answer_data.db_data_id) {
          db_data_id = item.answer_data.db_data_id
        } else {
          db_data_id = ''
        }
        // 先拿到用户选中的所有数据 循环用户所以选项 判断相等的
        item.option_list.forEach((option_list) => {
          if (item.answer_data.answer_value.length === 0) {
            newAnswer_values[0] = ''
            console.log('进来这里说没数据了')
          } else {
            item.answer_data.answer_value.forEach((answer_value, index) => {
              if (item.answer_data.other_data_value) {
                z[index] = item.answer_data.other_data_value[answer_value]
              }
              console.log('进来这里了吗!!!', answer_value)
              if (option_list.option_id === answer_value) {
              // 如果相等
                console.log('相等111111111111111111111111', option_list)
                if (option_list.is_other === 1) {
                  console.log('进来了其他哦', z[index])
                  newAnswer_values[newAnswer_values.length] = z[index] === undefined ? option_list.option_id + '&=>' + '' : option_list.option_id + '&=>' + z[index]
                } else {
                  newAnswer_values[newAnswer_values.length] = option_list.option_id
                }
              } else {
              //
                console.log('不相等', option_list, answer_value)
              }
            })
            console.log(' item.answer_data', item.answer_data)
          }
        })

        console.log('answer_values', item, newAnswer_values)
        questionData[0] = {
          question_id: item.question_id,
          db_data_id: db_data_id,
          answer_value: newAnswer_values.length === 0 ? '' : newAnswer_values
        }
      }
      // 下拉
      if (item.question_type === 3) {
        console.log('d下拉', e, item, twoVariable)

        let db_data_id
        if (item.answer_data.db_data_id) {
          db_data_id = item.answer_data.db_data_id
        } else {
          db_data_id = ''
        }
        // e.question_id
        questionData[0] = {
          question_id: item.question_id,
          db_data_id: [db_data_id],
          answer_value: [
            item.answer_data.answer_value
          ]
        }
      }
      // 文件上传
      if (item.question_type === 4) {
        console.log('文件上传6', item)
        // 拼接数据
        let db_data_id
        if (item.answer_data.db_data_id) {
          db_data_id = item.answer_data.db_data_id
        } else {
          db_data_id = ''
        }

        // if (item.answer_data.answer_value.length >= 2) {
        //   item.answer_data.answer_value.forEach((value) => {
        //     console.log('value', value)
        //   })
        // }
        // e.question_id
        questionData[0] = {
          question_id: item.question_id,
          db_data_id: [db_data_id],
          answer_value: item.answer_data.answer_value.length === 0 ? '' : [item.answer_data.answer_value]
        }
      }
      // 单行文本框 // 多行文本
      if (item.question_type === 5 || item.question_type === 6) {
        // 拼接数据
        let db_data_id
        if (item.answer_data.db_data_id) {
          db_data_id = item.answer_data.db_data_id
        } else {
          db_data_id = ''
        }
        // e.question_id
        questionData[0] = {
          question_id: item.question_id,
          db_data_id: [db_data_id],
          answer_value: [item.answer_data.answer_value]
        }
      }
      // 时间
      if (item.question_type === 7) {
        // 拼接数据
        let db_data_id
        if (item.answer_data.db_data_id) {
          db_data_id = item.answer_data.db_data_id
        } else {
          db_data_id = ''
        }
        // e.question_id
        questionData[0] = {
          question_id: item.question_id,
          db_data_id: [db_data_id],
          answer_value: item.answer_data.answer_value === null ? [''] : [item.answer_data.answer_value]
        }
      }

      console.log('将用户的数据拼接起来存起来', e, item, twoVariable)
      // twoVariable.item_id
      this.newregistration[0] = {
        item_id: twoVariable.item_id,
        item_data: [
          {
            itemRelationId: twoVariable.question_answer_list.length >= 1 ? twoVariable.question_answer_list[0].id : 0,
            questionData: questionData
          }
        ]

      }
      console.log('拼接好的数据', this.newregistration)
      // 将数据存到vuex中
      // 判断用户选中的是否有数据
      // 如果有需要判断第二次修改的数据和第一次修改的数据是否是同一个
      let xxx = 1
      let bbb = 0
      let aaa = 0
      let first = 1

      if (this.directoryListList.length >= 1) {
        // 有数据 需要判断
        const z = this.directoryListList
        z.forEach((newfirst, a) => {
          if (newfirst.item_id === this.newregistration[0].item_id) {
            first = 2
            newfirst.item_data.forEach((item_data, b) => {
              console.log('item_data', item_data)
              item_data.questionData.forEach((question, c) => {
                // questionData
                if (question.question_id === item.question_id) {
                  console.log('相等', question)
                  // 如果相等说明修改的是一个数据 把新的值赋上去就好了
                  // z[a].item_data[b].questionData.splice(c, 1)
                  // z[a].item_data[b].questionData.push(questionData[0])
                  z[a].item_data[b].questionData[c] = questionData[0]
                  xxx = 2
                } else {
                  // 如果不相等
                  console.log('不相等', z[a].item_data[b].questionData, this.newregistration[0].item_data[0].questionData[0])
                  // z[a].item_data[b].questionData.push(questionData[0])
                  // z[a].item_data[b].questionData[z[0].item_data[b].questionData.length] = []
                  // z[a].item_data[b].questionData[z[0].item_data[b].questionData.length] = questionData[0]
                  bbb = b
                  aaa = a
                }
              })
            })
          } else {
            // 如果不等于就直接push进去
            // z.push(this.newregistration[0])
            // xxx = 2
            aaa = a
          }
        })
        console.log('xxxx', xxx)
        if (xxx === 1) {
          // z[0]
          console.log('bbbb', z, bbb, z[aaa].item_data[bbb])
          // if (bbb !== 0) {
          z[aaa].item_data[bbb].questionData.push(questionData[0])
          console.log('进来了', z)
          // }
        }
        if (first === 1) {
          console.log('first等于1进来了', z, this.newregistration)
          // z.push(this.newregistration[0])
          z.push(this.newregistration[0])
        }

        console.log('zzz', z)
        this.directoryListList = z
        // this.$store.dispatch('medicalDetails/setDataStorage', z)
        this.$emit('directoryListList', z)
      } else {
        // 没有数据保存过 直接添加进去
        this.directoryListList = this.newregistration
        this.$emit('directoryListList', this.newregistration)
        // this.$store.dispatch('medicalDetails/setDataStorage', this.newregistration)
      }
    },
    onStart(e) {
      console.log('onStart', e)
    },
    // 用户点击单选
    clickitem(e, newchild, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('单选被点击了呀', e, newchild, twoVariable) // 判断是否相等
      if (e.option_id === newchild.answer_data.answer_value[0]) {
        // 如果相等清空
        newchild.answer_data.answer_value[0] = ''
      } else {
        // 如果不相等赋值上去
        if (e.is_other === 1) {
          if (newchild.answer_data.other_data_value) {
            //
          } else {
            newchild.answer_data.other_data_value = []
            newchild.answer_data.other_data_value[e.option_id] = ''
          }
        }
        newchild.answer_data.answer_value[0] = e.option_id
        // newchild.answer_data =
        // delete newchild.answer_data.other_data_value
        console.log('进来啦', newchild)
      }
      console.log(newchild.answer_data.answer_value[0], e.option_id)
      this.$forceUpdate()
      // newchild.answer_data.other_data_value = ''
      // 将数据拼接起来
      this.dataStorage(e, newchild, twoVariable)
    },
    // 单选输入框
    ChoiceInput(e, newchild, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('单选输入框', e, newchild, twoVariable)
      this.dataStorage(e, newchild, twoVariable)
      this.$forceUpdate()
    },
    // 用户点击多选
    changeinput(e, newchild, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('用户点击多选', e, newchild, twoVariable)
      console.log('newchild', newchild)
      if (newchild.answer_data.answer_value.length === 0) {
        // 如果不相等就添加进去

        if (e.is_other === 1) {
          if ('other_data_value' in newchild.answer_data) {
            newchild.answer_data.other_data_value[e.option_id] = ''
          } else {
            newchild.answer_data.other_data_value = []
            newchild.answer_data.other_data_value[e.option_id] = ''
          }
        }
        newchild.answer_data.answer_value.push(e.option_id)
      } else {
        //  如果有那么查看这个数据和用户选中的数据是否匹配
      // 如果匹配那么用户将这个id删除掉 如果没有就添加进去
        if (newchild.answer_data.answer_value.includes(e.option_id)) {
          newchild.answer_data.answer_value.forEach((list, i) => {
            if (list === e.option_id) {
              // if (e.is_other === 1) {
              //   newchild.answer_data.other_data_value[newchild.answer_data.answer_value[i]] = ''
              // }

              newchild.answer_data.answer_value.splice(i, 1)

              console.log('等于', newchild)
            }
          })
        } else {
        // 如果不相等就添加进去
          newchild.answer_data.answer_value.push(e.option_id)
          console.log('不等于', newchild)
        }
      }
      this.dataStorage(e, newchild, twoVariable)
    },
    // 多选输入框
    ChoiceInputs(e, newchild, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      console.log(e, newchild, twoVariable)
      this.dataStorage(e, newchild, twoVariable)
      this.$forceUpdate()
    },
    // 用户改变下拉框的值
    pullDown(newchild, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('用户改变下拉框的值', newchild, twoVariable)
      // 通过newchild拿到用户选中的数据
      let newe
      newchild.option_list.forEach((option_list) => {
        if (newchild.answer_data.answer_value === option_list.option_id) {
          newe = option_list
        }
      })
      // 拼接数据
      this.dataStorage(newe, newchild, twoVariable)
      //
    },
    // 用户输入单行文本
    inputBox(e, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('用户输入输入框', e, twoVariable)
      // 拼接数据
      this.dataStorage('', e, twoVariable)
    },
    // 用户输入多行文本
    multiLineText(e, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('eee', e, twoVariable)
      this.dataStorage('', e, twoVariable)
    },
    // 文件上传
    clickUpload(e, twoVariable) {
      if (this.readorcompile === 0) {
        return
      }
      // 用户进来 这里需要识别一下
      this.previewInsert = true
      console.log('eee', e, twoVariable)
      this.newsupload = e
      this.newTwoVariable = twoVariable
    },
    // 图片上传
    newpreview(e) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('newpreview', e)
      if (e.code === 1) {
        if (this.newsupload.answer_data.answer_value !== '') {
          console.log(this.newsupload.answer_data.answer_value, 'this.newsupload.answer_data.answer_value')
          // 深拷贝数据防止影响页面
          const xx = JSON.stringify(this.newsupload)
          const newz = JSON.parse(xx)
          const z = newz.answer_data.answer_value
          let newRes = ''
          console.log('zzzzzzzzzzz', z, newz, e)
          const HttpExtent = 'http://' + window.location.host
          if (typeof z === Array || z.length >= 1 && z.length <= 20) {
            z.forEach((item, i) => {
              if (process.env.NODE_ENV === 'development') {
                if (item.url.includes('http://api.qitaijk.cn')) {
                  newRes += item.url.substring(21) + ','
                } else {
                  newRes += item.url + ','
                }
              } else {
                if (item.url.includes(HttpExtent)) {
                  newRes += item.url.substring(HttpExtent.length) + ','
                } else {
                  newRes += item.url + ','
                }
              }
            })
            if (process.env.NODE_ENV === 'development') {
              this.newsupload.answer_data.answer_value[this.newsupload.answer_data.answer_value.length] = {
                url: 'http://api.qitaijk.cn' + e.data.url
              }
            } else {
              this.newsupload.answer_data.answer_value[this.newsupload.answer_data.answer_value.length] = {
                url: 'http://' + window.location.host + e.data.url
              }
            }
          //  this.newsupload.answer_data.answer_value[this.newsupload.answer_data.answer_value.length] = {
          //     url: e.data.url
          //   }
          } else {
            console.log('zzzzzz', z)
            // 通过,分割 includes 字符串
            if (z.length === 0) {
              if (process.env.NODE_ENV === 'development') {
                this.newsupload.answer_data.answer_value = 'http://api.qitaijk.cn' + e.data.url
              } else {
                this.newsupload.answer_data.answer_value = 'http://' + window.location.host + e.data.url
              }
            } else {
              const character = z.split(',')
              console.log(character, 'character')
              character.forEach((item) => {
                if (process.env.NODE_ENV === 'development') {
                  if (item.includes('http://api.qitaijk.cn')) {
                    newRes += item.substring(21) + ','
                  } else {
                    newRes += item + ','
                  }
                } else {
                  if (item.includes(HttpExtent)) {
                    newRes += item.substring(HttpExtent.length) + ','
                  } else {
                    newRes += item + ','
                  }
                }
              })
              if (process.env.NODE_ENV === 'development') {
                this.newsupload.answer_data.answer_value += ',' + 'http://api.qitaijk.cn' + e.data.url
              } else {
                this.newsupload.answer_data.answer_value += ',' + 'http://' + window.location.host + e.data.url
              }
            }

            // this.newsupload.answer_data.answer_value += ',' + e.data.url
            console.log('newRes', newRes, newz)
          }
          newRes += e.data.url
          newz.answer_data.answer_value = newRes
          console.log('ssss', newRes, this.newsupload, newz, this.newsupload.answer_data)
          this.dataStorage('', newz, this.newTwoVariable)
          if (z.length === 0) {
            if (process.env.NODE_ENV === 'development') {
            // 'http://api.qitaijk.cn'
              this.newsupload.answer_data.answer_value = []
              this.newsupload.answer_data.answer_value[0] = { url: 'http://api.qitaijk.cn' + e.data.url }
              newz.answer_data.answer_value = e.data.url
            } else {
              this.newsupload.answer_data.answer_value = []
              // 'http://' + window.location.host
              this.newsupload.answer_data.answer_value[0] = { url: 'http://' + window.location.host + e.data.url }
              newz.answer_data.answer_value = e.data.url
            }
          }
          // this.newsupload.answer_data.answer_value[this.newsupload.answer_data.answer_value.length] = {
          //   url: e.data.url
          // }
        } else {
          const xx = JSON.stringify(this.newsupload)
          const newz = JSON.parse(xx)
          // let z = newz.answer_data.answer_value
          if (process.env.NODE_ENV === 'development') {
            // 'http://api.qitaijk.cn'
            this.newsupload.answer_data.answer_value = []
            this.newsupload.answer_data.answer_value[0] = { url: 'http://api.qitaijk.cn' + e.data.url }
            newz.answer_data.answer_value = e.data.url
          } else {
            this.newsupload.answer_data.answer_value = []
            // 'http://' + window.location.host
            this.newsupload.answer_data.answer_value[0] = { url: 'http://' + window.location.host + e.data.url }
            newz.answer_data.answer_value = e.data.url
          }
          //
          console.log('newz', newz, 'this.newTwoVariable', this.newTwoVariable)
          this.dataStorage('', newz, this.newTwoVariable)
        }
        console.log('this.directoryList', this.directoryList, this.newsupload.answer_data.answer_value)
        this.$forceUpdate()
        // this.newsupload.answer_data.answer_value[this.newsupload.answer_data.answer_value.length] = {
        //   url: e.data.url
        // }
      } else {
        this.$message.error(e.msg)
      }
    },
    // 删除图片
    newremove(e) {
      if (this.readorcompile === 0) {
        return
      }
      console.log('newremove', e)
      this.removeDelate = true
      if ('response' in e) {
        this.DetalReomve = e.response.data
      } else {
        this.DetalReomve = e
      }
      // return this.$confirm('确定移除吗？')
      // return this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
      //   confirmButtonText: '确定',
      //   cancelButtonText: '取消',
      //   type: 'warning'
      // }).then(() => {
      //   this.$message({
      //     type: 'success',
      //     message: '删除成功!'
      //   })
      // }).catch(() => {
      //   this.$message({
      //     type: 'info',
      //     message: '已取消删除'
      //   })
      // })
    },
    // 点击删除数据
    fileDeleteI(e, xxxx, twoVariable) {
      console.log('用户点击删除', e, xxxx, twoVariable)
      console.log('e', e, xxxx, twoVariable)
      if (typeof xxxx.answer_data.answer_value === Array || xxxx.answer_data.answer_value.length >= 1 && xxxx.answer_data.answer_value.length <= 20) {
        xxxx.answer_data.answer_value.forEach((answer_value, i) => {
          // if (typeof item === 'object' && 'url' in answer_value) {
          //   console.log('answer_value.url === e.url', answer_value.url, e.url)
          //   if (answer_value.url === e.url) {
          //     console.log('进来这里说明就是需要删除的数据', answer_value)
          //     xxxx.answer_data.answer_value.splice(i, 1)
          //   }
          // } else {
          //   console.log('answer_value === e.url', answer_value, e.url)
          if (answer_value === e.url || answer_value.url === e.url) {
            console.log('进来这里说明就是需要删除的数据', answer_value)
            xxxx.answer_data.answer_value.splice(i, 1)
          }
          // }
        })
      } else {
        if (xxxx.answer_data.answer_value.length === 0) {
          console.log('等于0的时候进来了')
        } else {
          console.log('当是新增的时候进来这里', xxxx)
          const character = xxxx.answer_data.answer_value.split(',')
          character.forEach((url, i) => {
            console.log(url, e.url, url === e.url)
            if (url === e.url) {
              console.log('进来了！！！ma1')
              character.splice(i, 1)
            }
          })
          xxxx.answer_data.answer_value = character
          console.log(character, 'character', xxxx)
        }
      }
      console.log(xxxx, twoVariable)
      if (xxxx.answer_data.answer_value !== '') {
        console.log(xxxx.answer_data.answer_value, 'this.newsupload.answer_data.answer_value')
        // 深拷贝数据防止影响页面
        const xx = JSON.stringify(xxxx)
        const newz = JSON.parse(xx)
        const z = newz.answer_data.answer_value
        let newRes = ''
        console.log('zzzzzzzzzzz', z, newz)
        const HttpExtent = 'http://' + window.location.host
        if (typeof z === Array || z.length >= 1 && z.length <= 20) {
          // if ('url' in z) {
          console.log('进来这里啦！！！！', z)
          z.forEach((item, i) => {
            console.log('typeof itemtypeof item', typeof item === 'object')
            // if(typeof item === )
            if (typeof item === 'object' && 'url' in item) {
              console.log('不是字符串进来这里')
              if (process.env.NODE_ENV === 'development') {
                if (item.url.includes('http://api.qitaijk.cn')) {
                  newRes += item.url.substring(21) + ','
                } else {
                  newRes += item.url + ','
                }
              } else {
                if (item.url.includes(HttpExtent)) {
                  newRes += item.url.substring(HttpExtent.length) + ','
                } else {
                  newRes += item.url + ','
                }
              }
            } else {
              console.log('字符串进来这里')
              if (process.env.NODE_ENV === 'development') {
                if (item.includes('http://api.qitaijk.cn')) {
                  newRes += item.substring(21) + ','
                } else {
                  newRes += item + ','
                }
              } else {
                if (item.includes(HttpExtent)) {
                  newRes += item.substring(HttpExtent.length) + ','
                } else {
                  newRes += item + ','
                }
              }
            }
          })
          newz.answer_data.answer_value = newRes.substring(0, newRes.length - 1)
        } else {
          if (z.length === 0) {
            newz.answer_data.answer_value = []
          } else {
            // 通过,分割 includes 字符串
            const character = z.split(',')
            console.log(character, 'character')
            character.forEach((item) => {
              if (process.env.NODE_ENV === 'development') {
                if (item.includes('http://api.qitaijk.cn')) {
                  newRes += item.substring(21) + ','
                } else {
                  newRes += item + ','
                }
              } else {
                if (item.includes('http://' + window.location.host + item)) {
                  newRes += item.substring(HttpExtent.length)
                } else {
                  newRes += item + ','
                }
              }
            })
            console.log('newRes', newRes, newz)
            newz.answer_data.answer_value = newRes.substring(0, newRes.length - 1)
          }

          console.log(newRes, 'newRes', newz.answer_data.answer_value)
        }

        console.log('ssss', newRes, this.newsupload, newz)
        this.dataStorage('', newz, twoVariable)
        // this.newsupload.answer_data.answer_value[this.newsupload.answer_data.answer_value.length] = {
        //   url: e.data.url
        // }
      } else {
        // this.dataStorage('', this.newsupload, this.newTwoVariable)
      }
    },
    // 点击跳转
    newDevelopment(e) {
      console.log('触发了11111111111111', e)
      //  const { href } = this.$router.resolve({ name: 'Detailed', query: { name: e.user_name }})
      window.open(e.url, '_blank')
    },
    newonChange() {
      console.log('newonChangedddddddddddddd')
    },
    // 点击图片/文件触发
    newremoves(e, xxxx, twoVariable) {
      console.log('window.location.protocol', e, xxxx)
      if (this.removeDelate) {
        this.removeDelate = false
        // 如果用户进入这里相当于是删除图片
        console.log('this.DetalReomve', this.DetalReomve, xxxx, twoVariable)
        if (typeof xxxx.answer_data.answer_value === Array || xxxx.answer_data.answer_value.length >= 1 && xxxx.answer_data.answer_value.length <= 20) {
          xxxx.answer_data.answer_value.forEach((answer_value, i) => {
            // if (typeof item === 'object' && 'url' in answer_value) {
            //   console.log('answer_value.url === this.DetalReomve.url', answer_value.url, this.DetalReomve.url)
            //   if (answer_value.url === this.DetalReomve.url) {
            //     console.log('进来这里说明就是需要删除的数据', answer_value)
            //     xxxx.answer_data.answer_value.splice(i, 1)
            //   }
            // } else {
            //   console.log('answer_value === this.DetalReomve.url', answer_value, this.DetalReomve.url)
            if (answer_value === this.DetalReomve.url || answer_value.url === this.DetalReomve.url) {
              console.log('进来这里说明就是需要删除的数据', answer_value)
              xxxx.answer_data.answer_value.splice(i, 1)
            }
            // }
          })
        } else {
          if (xxxx.answer_data.answer_value.length === 0) {
            console.log('等于0的时候进来了')
          } else {
            console.log('当是新增的时候进来这里', xxxx)
            const character = xxxx.answer_data.answer_value.split(',')
            character.forEach((url, i) => {
              console.log(url, this.DetalReomve.url, url === this.DetalReomve.url)
              if (url === this.DetalReomve.url) {
                console.log('进来了！！！ma1')
                character.splice(i, 1)
              }
            })
            xxxx.answer_data.answer_value = character
            console.log(character, 'character', xxxx)
          }
        }
        console.log(xxxx, twoVariable)
        if (xxxx.answer_data.answer_value !== '') {
          console.log(xxxx.answer_data.answer_value, 'this.newsupload.answer_data.answer_value')
          // 深拷贝数据防止影响页面
          const xx = JSON.stringify(xxxx)
          const newz = JSON.parse(xx)
          const z = newz.answer_data.answer_value
          let newRes = ''
          console.log('zzzzzzzzzzz', z, newz)
          const HttpExtent = 'http://' + window.location.host
          if (typeof z === Array || z.length >= 1 && z.length <= 20) {
            // if ('url' in z) {
            console.log('进来这里啦！！！！', z)
            z.forEach((item, i) => {
              console.log('typeof itemtypeof item', typeof item === 'object')
              // if(typeof item === )
              if (typeof item === 'object' && 'url' in item) {
                console.log('不是字符串进来这里')
                if (process.env.NODE_ENV === 'development') {
                  if (item.url.includes('http://api.qitaijk.cn')) {
                    newRes += item.url.substring(21) + ','
                  } else {
                    newRes += item.url + ','
                  }
                } else {
                  if (item.url.includes(HttpExtent)) {
                    newRes += item.url.substring(HttpExtent.length) + ','
                  } else {
                    newRes += item.url + ','
                  }
                }
              } else {
                console.log('字符串进来这里')
                if (process.env.NODE_ENV === 'development') {
                  if (item.includes('http://api.qitaijk.cn')) {
                    newRes += item.substring(21) + ','
                  } else {
                    newRes += item + ','
                  }
                } else {
                  if (item.includes(HttpExtent)) {
                    newRes += item.substring(HttpExtent.length) + ','
                  } else {
                    newRes += item + ','
                  }
                }
              }
            })
            // } else {
            //   console.log('没有url进来这里啦啦啦啦')
            //   z.forEach((item, i) => {
            //     if (process.env.NODE_ENV === 'development') {
            //       if (item.includes('http://api.qitaijk.cn')) {
            //         newRes += item.substring(21) + ','
            //       } else {
            //         newRes += item + ','
            //       }
            //     } else {
            //       if (item.includes('http://' + window.location.host + item)) {
            //         newRes += item.substring(HttpExtent.length)
            //       } else {
            //         newRes += item + ','
            //       }
            //     }
            //   })
            // }
            // console.log('newRes', newRes)
            newz.answer_data.answer_value = newRes.substring(0, newRes.length - 1)
          } else {
            if (z.length === 0) {
              newz.answer_data.answer_value = []
            } else {
            // 通过,分割 includes 字符串
              const character = z.split(',')
              console.log(character, 'character')
              character.forEach((item) => {
                if (process.env.NODE_ENV === 'development') {
                  if (item.includes('http://api.qitaijk.cn')) {
                    newRes += item.substring(21) + ','
                  } else {
                    newRes += item + ','
                  }
                } else {
                  if (item.includes('http://' + window.location.host + item)) {
                    newRes += item.substring(HttpExtent.length)
                  } else {
                    newRes += item + ','
                  }
                }
              })
              console.log('newRes', newRes, newz)
              newz.answer_data.answer_value = newRes.substring(0, newRes.length - 1)
            }

            console.log(newRes, 'newRes', newz.answer_data.answer_value)
          }

          console.log('ssss', newRes, this.newsupload, newz)
          this.dataStorage('', newz, twoVariable)
          // this.newsupload.answer_data.answer_value[this.newsupload.answer_data.answer_value.length] = {
          //   url: e.data.url
          // }
        } else {
          // this.dataStorage('', this.newsupload, this.newTwoVariable)
        }
      } else {
        if (this.previewInsert) {
          this.previewInsert = false
        } else {
          console.log('e, twoVariable', e, e.target.src)
          if (e.target.src === undefined) {
            console.log('eeee', e)
            return
          } else {
            console.log('e, twoVariable', e, e.target.src)
            // window.location.href = e.target.src
            window.open(e.target.src, '_blank')
          }
        }
      }
    },
    // 用户输入时间信息
    newTime(e, twoVariable) {
      console.log('用户输入时间信息', e, twoVariable)
      this.dataStorage('', e, twoVariable)
    }
  }
}
</script>
<style>
/* 修改el-upload内部样式 */
.upload-demo .el-upload{
  width: 100%;
}
.upload-demo .el-upload-list{
  display: none;
}

/* 修改el-input内部结构 */
.grid-content-align  .el-input .el-input__count{
      right: -50px !important;
      position: relative;
}
.grid-content-align .el-textarea .el-input__count{
      right: -50px !important;
}

</style>

<style lang="scss" scope>
// ===================文件上传
.upload-demo{
  width: 100%;
  .upload-demo-btn{
    width:100%;
    display:flex;
    margin-left:4px
  }
  .upload-demo-tip{
    text-align:left;
    margin-left:4px
  }
  .upload-demo-text{
    height:25px;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 0px 6px 0px 4px;
    span{
      color: #262626;
    }
    .upload-demo-text-align{
      white-space: nowrap;
      word-break: break-all;
      overflow: hidden;
      text-overflow: ellipsis;
      text-align: left;
    }

    .upload-demo-text-align i{
      height:12px;
      width:12px;
      margin-right:7px;
      color: #909399;
    }
    .upload-demo-text-close{
      display: none;
    }

  }
  .upload-demo-text:hover{

    background: #f5f7fa;
    span{
      color: #66b1ff;
    }
    .el-icon-upload-success{
       display: none;
    }
    .upload-demo-text-close{
      display: inline-block;
    }
  }
}

// =================
.one-header-top{
  margin-top: 0 !important;
}
// 选中拖动的样式
.chose-child-class{
  border: solid 1px #2e8fff !important;
}
.grid-content-align .el-radio{
  white-space: normal;
}
// 自动适应布局row/eol
// 表格样式
.tool {
  display: flex;
  align-items: flex-start;
}
.wrap-main{
  min-height:60px;
  border: 1px solid rgba(220, 223, 230, 0.5);
}
  .grid-main{
    width: 100%;
  }
  .grid-child{
    color: #262626;
    // border-top: 1px solid #cdcdcd;
    height: 100%;
    .grid-child-row{
      height: 100%;
    }
  }
  .grid-content {
    min-height: 50px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    border-left: 1px solid rgba(220, 223, 230, 0.5);
  }
  .grid-content-name-align-left{
    height:100%;
    width:90%;
    display:flex;
    align-items:center;
    white-space: normal;
    word-break: break-all;
  }
  .grid-content-name-align{
  height: 100%;
  margin-left: 20px;
  display: flex;
  justify-content: space-between;
}
.grid-content-align{
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px;
  // 多选换行
  .grid-content-align-checkbox{
    padding:8px;
    white-space: normal;
    word-break: break-all;
    display: flex;
    align-items: center;
  }
}
// 创建成功
.create-success {
  position: fixed;
  top: 0;
  height: 50px;
  width: 100px;
  right: 30px;
  div {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
  }
}
.noData {
  width: 150px;
  height: 150px;
  font-size: 16px;
}
.noData img {
  width: 120px;
  height: 120px;
}
.noData-1 {
  width: 120px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  color: #cdcdcd;
}
.noData-2 {
  display: flex;
  justify-content: center;
  align-items: center;
}
.bgc_w_varid {
  position: relative;
  padding: 9px 15px;
  line-height: 20px;
  font-size: 14px;
}

.nameStyle {
  width: 20%;
  height: 100%;
  padding: 7% 0 0 5%;
  border-right: 1px solid #e6e6e6;
}
.nameStyles {
  width: 16%;
  height: 100%;
  padding: 4% 0 0 4%;
  border-right: 1px solid #e6e6e6;
}
.detailsStyle {
  flex: 1;
  padding-left: 2%;
}
.newVariable {
  width: 100%;
  display: flex;
  align-items: center;
  height: 100%;
  border-bottom: 1px solid #e6e6e6;
  border-right: 1px solid #e6e6e6;
}
.wrap {
  background: white;
}
// 添加模块和变量
.navthiss {
  height: 100vh;
  width: 231px;
  position: fixed;
  right: 1%;
  top: 50px;
  z-index: 99;
  border: 1px solid white;
  box-shadow: 0 0 1px 0px rgba(205, 205, 205, 0.6);
  background-color: white;
  .navthiss-header {
    top: 50px;
    position: fixed;
    right: 1%;
    z-index: 100;
    margin: 0;
    height: 50px;
    width: 231px;
    display: flex;
    background: #fff;
    justify-content: center;
    div {
      height: 100%;
      line-height: 50px;
      width: 50%;
      text-align: center;
    }
    .navthiss-header-select {
      color: #54a4ff;
      border: 1px solid #cdcdcd;
      background: #f7f7ff;
    }
  }
  .navthiss-content {
    padding-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding-bottom: 100px;
    overflow: scroll;
  }
  .navthiss-content-add {
    width: 180px;
    height: 36px;
    margin: 15px 0;
    line-height: 40px;
    text-align: center;
    border: 1px solid rgba(46, 143, 255, 1);
    color: rgba(46, 143, 255, 1);
    border-radius: 40px;
  }
  .wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    .navthiss-content-item {
      cursor: move;
      width: 180px;
      min-height: 36px;
      line-height: 20px;
      text-align: center;
      border: 1px solid #cdcdcd;
      color: black;
      white-space: normal;
      margin-bottom: 15px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
  }
}

// 二级变量名
.item-name {
  width: 100%;
  height: 50px;
  line-height: 50px;
  padding-left: 4px;
  padding-right: 15px;
  font-weight: normal;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  background: #f7f7f7;
}
// 添加题组
.varisible-item .el-form-item__content {
  margin: 0 !important;
}
.dimensionless{
  font-size: 16;
}
</style>
